package gemini.basic.manager;

import gemini.basic.model.Bill;
import gemini.basic.model.Cart;
import gemini.basic.model.Order;
import gemini.basic.model.Payment;
import gemini.basic.model.Person;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

@Transactional(rollbackFor = Throwable.class)
public interface ShoppingManager {

	public Cart getOpenCartByDistributorId(int distributorId);
	
	public Order saveOrder(Order order);

	public Order updateOrder(Order order);
	
	public void deleteOrder(Order order) ;
	
	public List<Order> saveOrUpdateOrders(List<Order> orders);

	public void deleteOrders(List<Order> orders);

	public Cart createCart(Person person);

	public int findAndDeleteUnusedDatabase();

	public Integer completeCart(int cartId, Payment payment);
	
	public void checkOut(Payment payment);

	public int checkPayment();
	
	public int processCart();
	
	public List<Bill> getBillByDistributorCode(String id);


}
